<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>递归 求幂</title>
</head>
<body>
    
    <script>
    
        // 求幂 -> 递归求幂
        function fn (num) {
            if(num==1){
                return num;
            }else {
                return num*fn(num-1);
            }
        }

        console.log(fn(5));

    </script>
</body>
</html>